<template>
    <div class="customer">
        <div class="tab">
            <!--顾客列表-->
            <el-row>
                <div>
                    <el-table
                            :data="rabbitAndCustomerList"
                            stripe="true"
                            border="true"
                            style="width: 100%">
                        <el-table-column
                                prop="period"
                                label="生长时期" style="width: 5%">
                        </el-table-column>
                        <el-table-column
                                prop="note"
                                label="需要注意" style="width: 30%">
                        </el-table-column>
                        <el-table-column
                                prop="responseplan"
                                label="应对方案" style="width: 35%">
                        </el-table-column>

                    </el-table>
                </div>
            </el-row>
        </div>
        <!--分页条-->
        <div>
            <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="1"
                    :page-sizes="[3,5,7,9]"
                    :page-size="pageSize"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="totalCount">
            </el-pagination>
        </div>
    </div>

</template>

<script>
    export default {
        // name: "rabbitAndCustomer",
        data() {
            return {
                totalPage: 1,
                pageNum: 1,
                pageSize: 3,
                total: 0,
                totalCount: 0,
                QueryForm: {
                    search: ''
                },
                rabbitAndCustomerList: []

            }
        },
        methods: {
            handleSizeChange(pageSize){
                this.pageSize = pageSize
                this.QueryRaisingSkills()
            },
            handleCurrentChange(pageNum){
                this.pageNum  = pageNum
                this.QueryRaisingSkills()
            },
            QueryRaisingSkills() {
                this.rabbitAndCustomerList = []
                this.$http.get('/lifeCourseDO/query', {
                    params: {
                        pageNum: this.pageNum,
                        pageSize: this.pageSize,
                        search: this.QueryForm.search
                    }

                }).then(res => {
                    this.totalCount = res.data.data.totalCount
                    this.total = res.data.data.total
                    this.totalPage = res.data.data.totalPage
                    this.pageSize = res.data.data.pageSize
                    this.rabbitAndCustomerList = res.data.data.list.slice( (this.pageNum-1)*this.pageSize,this.pageNum*this.pageSize)
                    console.log(res.data.data.list)
                })
            }
        } ,created() {
            this.QueryRaisingSkills();
        },
    }
</script>

<style scoped>
    @import url("LC.css");
</style>